﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;

namespace Wp7nl.Converters
{
    /// <summary>
    /// Converts a single value to a list with that single value
    /// </summary>
    public class ToListConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var l = new List<object> ();
            if (value != null) l.Add(value);
            return l;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
